package com.example.myapplication;

import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;

import com.vip.vcsp.multiprocess.MultiProcessManager;

public class MainActivity extends AppCompatActivity {

    TextView view;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        view = findViewById(R.id.textView);
        view.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                startPage();
            }
        });
        initData();
    }

    private void startPage(){
        Intent i = new Intent(this,Main2Activity.class);
        startActivity(i);
    }

    private void initData(){
        Fruit f = Fruit.getInstance();
        f.setApple(new Apple(10,20));
        MultiProcessManager.register(f);
    }
}
